version: 5.0.0.{build}
configuration: Debug
image: Visual Studio 2022

environment:
  DOTNET_CLI_UI_LANGUAGE: en
  DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  DOTNET_CLI_TELEMETRY_OPTOUT: 1
  SuppressNETCoreSdkPreviewMessage: true
  PATH: C:\Python36-x64;C:\Python36-x64\Scripts;%PATH%

init:
  - git config --global core.autocrlf true

install:
  - cmd: dotnet tool install --tool-path . nbgv
  - cmd: dotnet tool install --tool-path . coverlet.console

before_build:
- systeminfo
- '"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"'
- rem python -m pip install --upgrade pip
- rem pip install --upgrade pygount sphinx sphinx_rtd_theme
- rem pygount -f summary Source/Libs                       -s cs -N "*.Designer.cs" -F "obj"
- rem pygount -f summary Source/Libs/AM.Core5/Source       -s cs -N "*.Designer.cs" -F "obj"
- rem pygount -f summary Source/Libs/ManagedIrbis5/Source  -s cs -N "*.Designer.cs" -F "obj"
- rem pygount -f summary Source/Libs/AM.Scripting/Source   -s cs -N "*.Designer.cs" -F "obj"
- rem pygount -f summary Source/Tests                      -s cs -N "*.Designer.cs" -F "obj"
- rem pygount -f summary Source/Apps                       -s cs -N "*.Designer.cs" -F "obj"
- dotnet --info
- nbgv cloud
- dotnet build --configuration Release Source\Utils\Utils-windows.sln

build_script:
- dotnet build --configuration Release Source\ManagedIrbis5-windows.sln
- dotnet build --configuration Release Source\TinyClient.sln

test_script:
- dotnet test Source/ManagedIrbis5-windows.sln --no-restore --no-build --configuration Release --settings sequential.runsettings --collect "XPlat Code Coverage" --blame-hang-timeout 5m --blame-hang-dump-type full --blame-crash-dump-type full
- dotnet run  --no-restore --no-build --configuration Release --project Source/Tests/PftTests/PftTests.csproj
- dotnet run  --no-restore --no-build --configuration Release --project Source/Tests/BarsikTestRunner/BarsikTestRunner.csproj

after_build:
- dotnet pack    --no-restore --no-build --configuration Release --property:PackageOutputPath=%APPVEYOR_BUILD_FOLDER%\NuGet   Source\ManagedIrbis5-publish.sln
- dotnet pack    --no-restore --no-build --configuration Release --property:PackageOutputPath=%APPVEYOR_BUILD_FOLDER%\NuGet   Source\Libs\TinyClient\TinyClient.csproj
- dotnet publish --no-restore --no-build --configuration Release --property:PublishDir=%APPVEYOR_BUILD_FOLDER%\Publish        Source\ManagedIrbis5-publish.sln
- dotnet publish --no-restore --no-build --configuration Release --property:PublishDir=%APPVEYOR_BUILD_FOLDER%\Publish        Source\Libs\TinyClient\TinyClient.csproj

artifacts:
  - path: 'NuGet\'
    name: 'NuGet packages'

  - path: 'Publish\'
    name: 'Binaries'
